package com.abel.bigwater.data.jnrq

import com.abel.bigwater.data.BcdString
import com.alibaba.fastjson.annotation.JSONField
import com.fasterxml.jackson.annotation.JsonIgnore

class RtuMeter {
    var rtuAddrInt: Int? = null

    var meterAddrList: ArrayList<String>? = null
        set(value) {
            field = value
            meterAddrStrList = ArrayList()
            for (str in value.orEmpty()) {
                meterAddrStrList!!.add(BcdString.fromBcdString(str, true))
            }
        }

    @JsonIgnore
    @JSONField(deserialize = false, serialize = false)
    var meterAddrStrList: ArrayList<BcdString>? = null

    var meterBrand: String? = null

    var meterBrandInt: Int? = null

    var pressureLowLimit: Int? = null

    var pressureHighLimit: Int? = null

    var bps: Int? = null

    var check: Int? = null

    var downloaded: Boolean = false

    var streamTypeId: Int? = null

    var ipStr: String? = null

    var port: Int? = null
}

class RtuMeterCollection {
    var firmId: String? = null

    var firmCode: String? = null

    var firmName: String? = null

    var rtuMeterList: ArrayList<RtuMeter>? = null
}